package com.parleys.android.server.util;

import java.util.List;

import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.Predicate;

import com.parleys.server.domain.AbstractEntity;
import com.parleys.server.domain.News;

public class ParleysServiceUtils {

	private ParleysServiceUtils() {
	}
	
	public static void filterEntity(final List<? extends AbstractEntity> newsList, final long from) {
		CollectionUtils.filter(newsList, new Predicate() {
			@Override
			public boolean evaluate(Object obj) {
				News news = (News) obj;
				return (news.getCreatedOn().getTime() > from);
			}
		});
	}
	
}
